package com.ef.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.ef.constant.EMarketingPlanState;
import com.ef.constant.StatusType;

@Entity
public class MarketingPlan implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

	@Enumerated(value = EnumType.STRING)
	private StatusType status = StatusType.VALID;
	@Column(length = 500)
	private String name;

	@ManyToOne(fetch = FetchType.EAGER)
	private AdChannel adChannel;

	@Temporal(TemporalType.TIMESTAMP)
	private Date startDate;

	@Temporal(TemporalType.TIMESTAMP)
	private Date endDate;

	private Double budget;

	private Double expense;

	private Integer targetLeadNumber;

	private Integer leadNumber;

	@Column(length = 400)
	private String address;

	@Enumerated(value = EnumType.STRING)
	private EMarketingPlanState state;

	@Column(length = 400)
	private String description;

	@ManyToMany(fetch = FetchType.LAZY)
	private List<PTE> ptes;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	private User updateUser;

	@Temporal(TemporalType.TIMESTAMP)
	private Date updateTime;

	public Integer getTargetLeadNumber() {
		return targetLeadNumber;
	}

	public void setTargetLeadNumber(Integer targetLeadNumber) {
		this.targetLeadNumber = targetLeadNumber;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public AdChannel getAdChannel() {
		return adChannel;
	}

	public void setAdChannel(AdChannel adChannel) {
		this.adChannel = adChannel;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public void setStatus(StatusType status) {
		this.status = status;
	}

	public List<PTE> getPtes() {
		return ptes;
	}

	public void setPtes(List<PTE> ptes) {
		this.ptes = ptes;
	}

	public StatusType getStatus() {
		return status;
	}

	public Integer getLeadNumber() {
		return leadNumber;
	}

	public void setLeadNumber(Integer leadNumber) {
		this.leadNumber = leadNumber;
	}

	public EMarketingPlanState getState() {
		return state;
	}

	public void setState(EMarketingPlanState state) {
		this.state = state;
	}

	public Double getBudget() {
		return budget;
	}

	public void setBudget(Double budget) {
		this.budget = budget;
	}

	public Double getExpense() {
		return expense;
	}

	public void setExpense(Double expense) {
		this.expense = expense;
	}

	public User getUpdateUser() {
		return updateUser;
	}

	public void setUpdateUser(User updateUser) {
		this.updateUser = updateUser;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
}
